CC = gcc 

CFLAGS = -g -Ibcoh/include -w

BASE_PATH = bcoh/base

OBJS = account.o ecc.o keccak256.o services.o contract.o 

BASE_OBJS = hash.o json.o log.o md5.o utils.o x509.o 

#  gcc -g bcoh/account/*.o bcoh/base/*.o bcoh/contract/*.o bcoh/crypto/*.o bcoh/services/*.o -Ibcoh/include qltest.c -o main -lcurl
main: qltest.c $(OBJS) $(BASE_OBJS)
	$(CC) $(CFLAGS) $^ -o $@ -lcurl

main.o: qltest.c
	$(CC) $(CFLAGS) -c $^ -o $@ 

account.o: bcoh/account/account.c 
	$(CC) $(CFLAGS) -c $^ -o $@

ecc.o: bcoh/crypto/ecc.c
	$(CC) $(CFLAGS) -c $^ -o $@

contract.o: bcoh/contract/contract.c
	$(CC) $(CFLAGS) -c $^ -o $@

keccak256.o: bcoh/crypto/keccak256.c
	$(CC) $(CFLAGS) -c $^ -o $@

services.o: bcoh/services/services.c 
	$(CC) $(CFLAGS) -c $^ -o $@

hash.o: $(BASE_PATH)/hash.c 
	$(CC) $(CFLAGS) -c $^ -o $@

json.o: $(BASE_PATH)/json.c 
	$(CC) $(CFLAGS) -c $^ -o $@

log.o: $(BASE_PATH)/log.c 
	$(CC) $(CFLAGS) -c $^ -o $@

md5.o: $(BASE_PATH)/md5.c 
	$(CC) $(CFLAGS) -c $^ -o $@

utils.o: $(BASE_PATH)/utils.c 
	$(CC) $(CFLAGS) -c $^ -o $@

x509.o: $(BASE_PATH)/x509.c 
	$(CC) $(CFLAGS) -c $^ -o $@

clean:
	rm -rf *.o